Skip to content

fix(platform-objects): Setup create_user / set_user_password offer one password rule — generatePassword is a constant, not a ticked box - #22838

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-22821-admin-password-choice
Oct 11, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-22821-admin-password-choice

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #22821
Clause-②: no

The Setup "Create User" and "Set Password" dialogs showed two controls for one decision: a "Generate Temporary Password" box and a password field labelled "leave empty to generate". With a password typed, the box did nothing, yet it went on the wire ticked. Now the password field's label is the only rule: generatePassword is no longer a dialog param on either action, and it rides in each action's bodyExtra as a constant true. The endpoint's existing explicit-wins rule (resolvePassword) then gives exactly the label's behaviour. packages/plugins/plugin-auth/src/admin-user-endpoints.ts is not edited, and the endpoint's contract for other callers is unchanged.

Measured before writing code (the dispatch's mechanism assumptions)

1. The action-param schema cannot express "never shown, still sent". The action schema can, with bodyExtra. Read on origin/main b7cd1af9d, packages/spec/src/ui/action.zod.ts:

  • visible (a param predicate): its own docs say the dialog omits the param when it is false. The carryOver docs record that visible: false omits the param from the dialog AND from the submission.
  • carryOver needs defaultFromRow: true, and create_user is a list_toolbar action with no row. It also renders a read-only summary the admin still sees.
  • bodyExtra (on ActionSchema) is "Static body fragment merged into the outgoing request body for type:'api' actions. Useful for constants the user shouldn't (or can't) edit", applied after the collected params. The carryOver refinement's own refusal points there: "(for a fixed value the user should not see) use the action's bodyExtra instead."

2. The Console that main bundles drops a hidden param's value, and posts bodyExtra on every path these two actions use. Read in objectui at .objectui-sha 20c6d351ad74d2b14a93becdc134d51b91b2d2e6:

  • packages/app-shell/src/views/ActionParamDialog.tsx: defaults are seeded only for visibleParams (the output of filterVisibleParams), and submit sends serializeParamValues(visibleParams, values). A hidden param's default is never posted. So the suggested hidden-param route would have answered 400 to every admin who left the field empty.
  • list_toolbar (create_user): ObjectView builds an action:bar. renderMember spreads the whole action onto action:button, which forwards bodyExtra: schema.bodyExtra to the runner. The mobile overflow action:menu forwards it too.
  • list_item (set_user_password): ObjectGrid's onActionDef forwards the whole def (...rest).
  • The runner (ActionRunner.execute) collects the params, then calls the console's registered api handler. In useConsoleActionRuntime.tsx that handler applies Object.assign(body, resolvePageVarTokens(action.bodyExtra, pageVars)) after the collected params and recordIdParam. A boolean leaf passes through resolvePageVarTokens unchanged.
  • record_header (set_user_password): RecordDetailView's apiHandler merges action.bodyExtra the same way, after recordIdParam.
  • Precedent on platform objects: resend_invitation (bodyExtra: { resend: true }) already sends a constant beside a params dialog. revoke_api_key / restore_api_key and transfer_ownership (both list_item actions) send bodyExtra constants as their whole payload.

Route. The route the seat chose, "a constant true the admin does not see; the endpoint is not edited", lands through bodyExtra rather than through a hidden param. It touches the same file, the same two actions, and the declared translation bundles.

Change

  • packages/platform-objects/src/identity/sys-user.object.ts: create_user and set_user_password lose the generatePassword param and gain bodyExtra: { generatePassword: true }. The password / newPassword labels ("leave empty to generate") are unchanged, and they are now the only instruction on the dialog.
  • packages/platform-objects/src/apps/translations/*.objects.generated.ts (4 files): regenerated with node scripts/check-i18n-bundles.mjs --write. The only diff is the two generatePassword label keys leaving each bundle (−6 lines per file). The other eight packages' bundles came back byte-identical.
  • packages/plugins/plugin-auth/src/admin-user-endpoints.test.ts: the pins (below).
  • .changeset/22821-admin-password-choice.md: @objectstack/platform-objects patch.

What the admin sees change. Create User: the box is gone, and the behaviour for an admin who left it ticked is unchanged. Set Password: the box defaulted to unticked there, so an empty field used to answer 400 unless the admin ticked it. Now an empty field generates a password, which is what its label always said.

Pins

These live in plugin-auth. The cross-lane declaration on #6367 covers only sys-user.object.ts and the generated bundles inside packages/platform-objects, so no test file there is touched. plugin-auth already depends on @objectstack/platform-objects and already imports @objectstack/platform-objects/identity in its tests.

  • Metadata half, read from the declared actions: for each of create_user and set_user_password, the dialog offers no generatePassword param, still offers the explicit password param, and bodyExtra.generatePassword === true.
  • Composition: the body is built the way the console builds it (collected values, then recordIdParam, then bodyExtra last), then driven through the real runAdminCreateUser / runAdminSetUserPassword.
    • Typed: the typed password is the one applied, with no temporaryPassword in the response.
    • Absent, and typed-then-cleared (''): a temporary password is generated, applied, returned once, and leaked nowhere.
  • Server rows: set-user-password gains the three rows create-user already had: explicit wins over generatePassword: true, empty plus true generates, and the CONTROL (neither field → 400 INVALID_REQUEST, nothing written). The existing create-user CONTROL row now asserts the envelope code beside the status.

Verification (all at a73ff6a0e)

  • pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/admin-user-endpoints.test.ts: 52 passed (52).
  • pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2: 136 files, 2780 passed, 10 skipped.
  • pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2: 69 files, 1082 passed.
  • pnpm --filter @objectstack/platform-objects typecheck and pnpm --filter @objectstack/plugin-auth typecheck: exit 0. check:test-typecheck held: plugin-auth 10 files / 94 errors / 23 signatures, unchanged.
  • Gates: node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran reads "66 derived famil(ies) accounted for — 66 run, 0 NOT-MEASURED (a DERIVED zero — all 66 recorded an exit code and none of them is 3)".
    • On the first pass two gates refused a prerequisite. check-plugin-teardown-shape --self-test could not read its pinned control commit in this shallow clone; after a depth-1 fetch of that commit it passed (48 cases). check:dual-build-cjs-loads found nine packages with no dist/; with those present it passed (107 entry points across 66 packages).
    • The dispatch's list also named check:dispatcher-error-vocabulary and check:error-status-conformance. Both exit 0.

Ablations (each mutation committed-first, then restored and proven equal to HEAD)

Mutations went through scripts/ablation-replace.mjs, with a bash trap restoring both paths on EXIT, INT and TERM. The pins read platform-objects through its exports (its dist/), so each metadata leg rebuilt it and proved the mutation reached dist/ with scripts/ablation-dist-preflight.mjs first.

  • A. The generatePassword control put back on both dialogs. On disk: 2 of 2. In dist/: present in 6 built files. Result: 2 failed / 50 passed, create_user and set_user_password "offers no generatePassword control", with AssertionError: expected [ Array(6) ] to not include 'generatePassword'.
  • B. The bodyExtra constant removed from both actions. On disk: 0 left, 2 placeholders. In dist/: absent. Result: 6 failed / 46 passed. The two "sends it as a constant" rows failed, and so did the four "absent / empty generates" rows, because the endpoint answered 400.
  • Restore leg for A and B: rebuild from HEAD. Marker A is absent from all 66 built files, marker B is present in 4, and the tree is clean.
  • C. The endpoint reads a missing generatePassword as "generate" (=== true becomes !== false in resolvePassword). On disk: 1. Result: 2 failed / 50 passed, both CONTROL rows, with expected 200 to be 400.
  • Every restore: blob equals HEAD, and git diff HEAD is empty. The final run at HEAD: 52 passed (52).

Acceptance notes

  • resolvePassword's docblock in admin-user-endpoints.ts still says "the console action dialog defaults generatePassword: true". The value is now a constant, not a default. The rule it describes is still true. Not edited: the file is outside this claim. Whoever next edits that file can correct the wording; no one is lined up for it today.
  • The checklist item in docs/qa/platform-checklist/areas/identity-auth.json that drives create-user with an explicit password AND generatePassword: true ("the console dialog sends both") still describes the wire exactly.

Generated by Claude Code

…assword as a constant, not a ticked box

The password field's own label ("leave empty to generate") is the one rule
the admin reads. generatePassword leaves both dialogs' params and rides in
bodyExtra as a constant true, so the endpoint's explicit-wins rule gives the
label's behaviour: a typed password wins, an empty one generates. The
endpoint's contract for other callers is unchanged.

Claude-Session: https://claude.ai/code/session_013LbZ9MhPp1iriZEtgJqioA
Co-authored-by: Claude <noreply@anthropic.com>
…he endpoint

The declared create_user / set_user_password actions are composed into the
body the console sends (collected params, recordIdParam, bodyExtra last) and
driven through the real endpoints: a typed password wins, an empty or absent
one generates. set-user-password gains the explicit-wins, empty-generates and
neither-is-400 control rows create-user already had; the create-user control
asserts the envelope code too.

Claude-Session: https://claude.ai/code/session_013LbZ9MhPp1iriZEtgJqioA
Co-authored-by: Claude <noreply@anthropic.com>
…sword leaves both dialogs

Regenerated with `node scripts/check-i18n-bundles.mjs --write`; only the
two generatePassword param labels leave the four objects bundles.

Claude-Session: https://claude.ai/code/session_013LbZ9MhPp1iriZEtgJqioA
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects, touching 1 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/authentication.mdx (via generatePassword (literal, a string literal in actions))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via generatePassword (literal, a string literal in actions))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: sys_user (symbol, 39 pages)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json efcbac73cc58510278b970949ac3b65cb9712815 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 35ac418935cfd5f937f2b6d3cba9299d3d18c900 — the merge of head a73ff6a0e5174bd12c7e7e8fa626e1f304c84998 into base efcbac73cc58510278b970949ac3b65cb9712815, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 35ac418935cfd5f937f2b6d3cba9299d3d18c900 && git checkout 35ac418935cfd5f937f2b6d3cba9299d3d18c900
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin efcbac73cc58510278b970949ac3b65cb9712815 a73ff6a0e5174bd12c7e7e8fa626e1f304c84998 && git checkout -B drift-repro efcbac73cc58510278b970949ac3b65cb9712815 && git merge --no-ff a73ff6a0e5174bd12c7e7e8fa626e1f304c84998

node scripts/docs-audit/affected-docs.mjs --json efcbac73cc58510278b970949ac3b65cb9712815

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs efcbac73cc58510278b970949ac3b65cb9712815 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 11, 2026 13:00
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 11, 2026 13:00
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 31b5a5f Oct 11, 2026
36 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-22821-admin-password-choice branch October 11, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants